package com.tricode.ile.training.task.sl275.lab8;

public class Account {

    private double balance;

    Account(double initBalance) {
        this.balance = initBalance;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public void deposit(double amount) {
        this.balance += amount;
    }

    public void withdraw(double amt) throws OverdraftException{
        if (balance >= amt) {
            balance = balance - amt;
        } else {
            throw new OverdraftException("Amount is too big");
        }
    }
}
